<template>
	<view class="main">
		<view class="hand">

			运营管理
		</view>
		<view class="show">
			<navigator url="../withdrawal_management/withdrawal_management?backid=0" >
			<view class="sone">
				<view class="soneleft">
					<image src="https://qiniu.jxyutuo.com/yanqin/tabBarimg//y1.png"></image>
					<view class="sonelefttxt">提现管理</view>
				</view>
				<view class="soneright">
					<image src="https://qiniu.jxyutuo.com/yanqin/tabBarimg//yright.png"></image>
				</view>
			</view>
			</navigator>
			<navigator url="../message_notification/message_notification">
			<view class="sone">
				<view class="soneleft">
					<image src="https://qiniu.jxyutuo.com/yanqin/tabBarimg//y2.png" ></image>
					<view class="sonelefttxt">消息通知</view>
				</view>
				<view class="soneright">
					<image src="https://qiniu.jxyutuo.com/yanqin/tabBarimg//yright.png"></image>
				</view>
			</view>
			</navigator>                                                                                                                            
			<!--盘古(user_id != '45420') && (user_id != '91390')-->
			<!--燕梅(user_id != '91146') && (user_id != '102918')-->
			<view class="sone" @click="gobtn" v-if="(user_id != '91146') && (user_id != '102918') && (user_id != '45420') && (user_id != '91390')">
				<view class="soneleft">
					<image src="https://qiniu.jxyutuo.com/yanqin/tabBarimg//y3.png"></image>
					<view class="sonelefttxt">项目管理</view>
				</view>
				<view class="soneright">
					<image src="https://qiniu.jxyutuo.com/yanqin/tabBarimg//yright.png"></image>
				</view>
			</view>
			
			
			<view class="sone" @click="tjbtn">
				<view class="soneleft">
					<image src="https://qiniu.jxyutuo.com/yanqin/tabBarimg//y4.png" ></image>
					<view class="sonelefttxt">项目统计</view>
				</view>
				<view class="soneright">
					<image src="https://qiniu.jxyutuo.com/yanqin/tabBarimg//yright.png"></image>
				</view>
			</view>
			<view class="sone" @click="simbtn" style="display: none;">
				<view class="soneleft">
					<image style="height: 31upx;" src="https://qiniu.jxyutuo.com/yanqin/tabBarimg//y5.png"></image>
					<view class="sonelefttxt">运营商流量卡</view>
				</view>
				<view class="soneright">
					<image src="https://qiniu.jxyutuo.com/yanqin/tabBarimg//yright.png"></image>
				</view>
			</view>
			<view class="sone" @click="cdxbtn" style="display: none;">
				<view class="soneleft">
					<image style="height: 45upx;" src="https://qiniu.jxyutuo.com/yanqin/tabBarimg//y6.png"></image>
					<view class="sonelefttxt">运营商场地险</view>
				</view>
				<view class="soneright">
					<image src="https://qiniu.jxyutuo.com/yanqin/tabBarimg//yright.png"></image>
				</view>
			</view>
			
		</view>
		<view style="display: none;" class="stwo" @click="carbtn">
			进入电动汽车充电系统
		</view>
	</view>
</template>

<script>
	import tou_hand1 from '../../components/tou_hand1/tou_hand1.vue'
	// import {
	// 	Dialog
	// } from 'vant';
	export default {
		components: {tou_hand1},
		mounted() {

		},

		data() {
			return {
				isBan:'',//权限
				backid:'',
				simdata:'',
				showSite:false,
				type:'',
				user_id: '',
			}
		},
		onLoad(option) {
			this.isBan=uni.getStorageSync('user').isBan;
			this.user_id = uni.getStorageSync('userId');
			this.backid=option.backid
			this.sim()
		},
		methods: {
			gobtn(){
				uni.setStorageSync('typeone',0)
				uni.navigateTo({
				       url: '/manager_pages/project_management/project_management',
				});
			},
			//返回上一页
			blackbtn() {
				if(this.backid==0){
					uni.navigateBack()
				}else{
					uni.redirectTo({
						url: '/pages/contact_kf/contact_kf'
					})
				}
				
			},
			//获取用户是否有项目统计的权限
			tjbtn(){
				this.$base.request1('manager/power/statistics', 'GET')
					.then(res => {
						if(res.data.code==200){
							if(res.data.data==true){
								uni.navigateTo({
								       url: '/manager_pages/project_statistics/project_statistics',
								});
							}else if(res.data.data==false){
								this.$toast.fail('您暂无权限')
							}
							
						}else{
							this.$toast.fail(res.data.msg)
						}
					})
					.catch(err => {
				
					})
			},
			carbtn(){
				var data={
					appid:uni.getStorageSync('user').appid
				}
				this.$base.request1('manager/wechatSetting/car/url', 'GET',data)
					.then(res => {
						if(res.data.code==200){
							window.location.href=res.data.data.url
						}else{
							this.$toast.fail(res.data.msg)
						}
					})
					.catch(err => {
				
				})
			},
			//运营商流量卡相关信息
			sim(){
				this.$base.request1('manager/simBindUser/simAdvent/info', 'GET')
					.then(res => {
						if(res.data.code==200){
							this.simdata=res.data.data
							this.type=res.data.data.type
							this.showSite=res.data.data.showSite
							let sim = 'sim_' + uni.getStorageSync('userId')
							let simnum=uni.getStorageSync(sim)
							if(this.simdata.bindNum==0&&simnum!=true){
								Dialog.confirm({
									title: '提示',
									message: '您尚未绑定sim卡系统账号，点击确认前往绑定',
								}).then(() => {
									uni.setStorageSync(sim, true)
									uni.navigateTo({
										url: '../simcard_add/simcard_add'
									})
								}).catch(() => {
									uni.setStorageSync(sim, true)
									return
								});
							}else{
								if(this.simdata.advNum>0){
									Dialog.confirm({
										title: '提示',
										message: '您有'+this.simdata.advNum+'张临期SIM卡，点击确认前往查看',
									}).then(() => {
										let managerUserId=uni.getStorageSync('userId')
										let userToken = uni.getStorageSync('userToken')
										window.location.href = 'http://weixiu.abcabc2.top/sim/wx/wxlogin'+'?managerUserId='+managerUserId+'&token='+userToken
									}).catch(() => {
										return
									});
								}
							}
						}else{
							this.$toast.fail(res.data.msg)
						}
					})
					.catch(err => {
				
				})
			},
			simbtn(){
				uni.navigateTo({
					url: '../simmid/simmid'
				})
			},
			cdxbtn(){
				uni.navigateTo({
					url: '../site_insurance_buy/site_insurance_buy'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.main {
		width: 100%;
		overflow-x: hidden;
		background-color:#fff;
		.hand{
			text-size-adjust: 100% !important;
			-webkit-text-size-adjust: 100% !important;  
			-moz-text-size-adjust: 100% !important;
			width: 100%;
			background-color: #4B98ED;
			font-size: 30upx;
			padding: 20upx 0;
			font-family: PingFang SC Bold, PingFang SC Bold-Bold;
			font-weight: 700;
			text-align: center;
			color: #ffffff;
			position: relative;
			image{
				width:22upx;
				height: 39upx;
				position: absolute;
				left: 31upx;
				top: 22upx;
			}
		}
		.show{
			 width: 100%;
			 box-sizing: border-box;
			 padding: 42upx 32upx;
			 background: linear-gradient(360deg, #F9FBFB 0%, #4B98ED 82%, #4B98ED 100%);
			 opacity: 1;
			.sone{
				width: 686upx;
				height: 88upx;
				border-radius: 16upx;
				margin: 0 auto;
				background: #FFFFFF;
				box-shadow: 0upx 14upx 16upx 1upx rgba(22,86,176,0.2);
				border-radius: 20upx;
				display: flex;
				box-sizing: border-box;
				justify-content: space-between;
				align-items: center;
				padding: 33upx 30upx ;
				margin-bottom: 10upx;
				.soneleft{
					display: flex;
					box-sizing: border-box;
					align-items: center;
					image{
						width: 45upx;
						height:40upx;
					}
					.sonelefttxt{
						font-size: 28upx;
						font-family: PingFang SC Medium, PingFang SC Medium-Medium;
						font-weight: 700;
						color: #333333;
						margin-left: 25upx;
					}
				}
				.soneright{
					display: flex;
					box-sizing: border-box;
					align-items: center;
					image{
						width: 13upx;
						height: 22upx;
					}
					.sonerighttxt{
						font-size: 24upx;
						font-family: PingFang SC Medium, PingFang SC Medium-Medium;
						font-weight: 500;
						color: #666666;
						margin-right: 14upx;
						margin-bottom: 4upx;
					}
				}
			}
			
		}
		.stwo{
			width: 408upx;
			height: 176upx;
			background: #3ec364;
			border-radius: 8upx;
			font-size: 40upx;
			font-family: PingFang SC Bold, PingFang SC Bold-Bold;
			font-weight: 700;
			text-align: center;
			padding: 38upx 80upx;
			box-sizing: border-box;
			// line-height: 70upx;
			color: #FFFFFF;
			margin: 0upx auto;
			margin-top: 50upx;
		}
		
	}
</style>
